//
//  LYTitleView.m
//  lottery
//
//  Created by 赵国腾 on 16/6/13.
//  Copyright © 2016年 赵国腾. All rights reserved.
//

#import "LYTitleView.h"

@implementation LYTitleView

- (void)layoutSubviews {
    [super layoutSubviews];
    
    if (self.imageView.gt_minX < self.titleLabel.gt_minX) {
        
        self.titleLabel.gt_minX = self.imageView.gt_minX;
        self.imageView.gt_minX = self.titleLabel.gt_maxX;
    }
    
}

- (void)setTitle:(NSString *)title forState:(UIControlState)state {
    [super setTitle:title forState:state];
    
    [self sizeToFit];
}

- (void)setImage:(UIImage *)image forState:(UIControlState)state {
    
    [super setImage:image forState:state];
    
    [self sizeToFit];
}

@end
